from selenium import webdriver
from selenium.webdriver.common.by import By
import time
driver=webdriver.Edge()
driver.maximize_window()
driver.get('https://www.baidu.com/')
time.sleep(3)
# 第一种高阶定位
# driver.find_element(By.XPATH,'//textarea[starts-with(@id,"chat-textarea")]').send_keys('习')
# 第二种高阶定位
# driver.find_element(By.XPATH,'//textarea[@id="chat-textarea" and @class="chat-input-textarea chat-input-scroll-style"]').send_keys('习')
# 第三种
driver.find_element(By.XPATH,'//textarea[contains(@id,"chat-textarea")]').send_keys('习')
# driver.switch_to.window(driver.window_handles[-1])
# time.sleep(3)
# driver.find_element(By.PARTIAL_LINK_TEXT,'习').click()
time.sleep(5)